<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <div id="app">
        <a v-bind:href="url" v-text="search"></a>
        <button @click="handle">切换</button>
    </div>
    <script src="./vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                url: 'http://www.baidu.com',
                search: '百度',
            },
            methods: {
                handle: function() {
                    this.url = 'http://www.itcast.com';
                    this.search = '黑马';
                },
            },
        });
    </script>
</body>

</html>